<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>my authorize page</title>
</head>
<body>
<form action="/oauth/authorize" method="post">
    <input type="hidden" name="user_oauth_approval" value="true">
    <div id="scope"></div>
    <input type="submit" value="授权">
</form>
<script>
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
</script>
<script>
    var scope = getQueryString("scope");

    var scopeList = scope.split(" ");
    var html = "";
    for (var i = 0; i < scopeList.length; i++) {
        html += scopeList[i] + "：<input type='checkbox' name='scope." + scopeList[i] + "' value='true'/><br />";
    }
    document.getElementById("scope").innerHTML = html;
</script>
</body>
</html>